<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const obj = {
            id: 1,
            age: 21,
            name: 'lisi'
        }
        // 序列化 (转换后是字符串)
        const obj2 = `{
            "id": 1,
            "age": 21,
            "name": "lisi"
        }`
        console.log(obj2);
        console.log(JSON.stringify(obj));

        // 反序列化
        console.log(JSON.parse(obj2));
        
        
    </script>
</body>
</html>